home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2003 December / The Sunday Times - The Month 2003-12.iso / mac / The Month DEC 03 / engine / modules / arts_quarter.swf / scripts / frame_1 / DoAction.as
Text File  |  2003-09-04  |  3KB  |  130 lines

  1. function loadImage(mc, node, extrapath)
  2. {
  3.    extrapath != null ? 0 : (extrapath = "");
  4.    var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
  5.    var strImg = node.getText();
  6.    var diffpath = node.attributes.path;
  7.    if(diffpath != null)
  8.    {
  9.       strImg = diffpath + strImg;
  10.    }
  11.    else
  12.    {
  13.       strImg = strDefaultPath + extrapath + strImg;
  14.    }
  15.    strPathPrefix != null ? 0 : (strPathPrefix = "");
  16.    mc.loadMovie(strPathPrefix + strImg);
  17. }
  18. function addLink(mc)
  19. {
  20.    Links[mc.link] = mc;
  21. }
  22. function getMCfromLink(Item)
  23. {
  24.    if(Links[Item] == null)
  25.    {
  26.       var arr = [];
  27.       while(Item != sideMenu.ItemHome)
  28.       {
  29.          arr.unshift(Item._name.split("_").pop());
  30.          Item = Item._parent._parent;
  31.       }
  32.       var str = arr.join("/");
  33.       Links[Item] = Links[str];
  34.    }
  35.    return Links[Item];
  36. }
  37. function removeLinkListener()
  38. {
  39.    Tardis.sideMenu.EB.removeListener(this);
  40. }
  41. function init()
  42. {
  43.    var strID = Tardis.ActiveSection.id;
  44.    var Colors = Tardis.Colors;
  45.    var strColor = Colors.getString(strID);
  46.    IMAGE_PATH = nodeData.attributes.imagepath;
  47.    SECTION_COLOR = Colors.getHex(strID);
  48.    DEFAULT_COLOR = Colors.getHex("default");
  49.    DEFAULT_COLOR50 = Colors.getHex("default50");
  50.    var mcToDisplay = "clip" + nodeData.childNodes.length + "MC";
  51.    attachMovie(mcToDisplay,"mc_module",++depth);
  52.    mc_module._x = 0;
  53.    mc_module._y = 0;
  54.    onComplete();
  55. }
  56. function setTextColor(fld, strHex)
  57. {
  58.    titleFF.textColor = parseInt("0x" + strHex);
  59. }
  60. function doOver(num)
  61. {
  62.    var mc = eval("mc_module.mc_txt_" + num);
  63.    mc.gotoAndStop("over");
  64.    if(mc.textOver)
  65.    {
  66.       _parent.preview.doOver(mc.num);
  67.    }
  68. }
  69. function doOut(num)
  70. {
  71.    var mc = eval("mc_module.mc_txt_" + num);
  72.    mc.gotoAndStop("off");
  73.    if(mc.textOver)
  74.    {
  75.       _parent.preview.doOut(mc.num);
  76.    }
  77. }
  78. function txtOver(mc)
  79. {
  80.    mc.gotoAndStop("over");
  81.    if(mc.textOver)
  82.    {
  83.       _parent.preview.doOver(mc.num);
  84.    }
  85.    if(mc.navLink)
  86.    {
  87.       Tardis.sideMenu.doOver(mc.link);
  88.    }
  89. }
  90. function txtOut(mc)
  91. {
  92.    mc.gotoAndStop("off");
  93.    if(mc.textOver)
  94.    {
  95.       _parent.preview.doOut(mc.num);
  96.    }
  97.    if(mc.navLink)
  98.    {
  99.       Tardis.sideMenu.doOut(mc.link);
  100.    }
  101. }
  102. function txtUp(mc)
  103. {
  104.    if(mc.navLink)
  105.    {
  106.       Tardis.sideMenu.doUp(mc.link);
  107.    }
  108.    else
  109.    {
  110.       Tardis.webPageOpen(mc.urlLink,"_blank");
  111.    }
  112. }
  113. function testEnabled(num)
  114. {
  115.    if(num >= nodeData.childNodes.length)
  116.    {
  117.       mcToAssign = eval("mc_txt_" + num);
  118.       mcToAssign.btn.enabled = 0;
  119.    }
  120. }
  121. Links = {};
  122. Tardis.sideMenu.EB.addListener(this);
  123. stop();
  124. onReady();
  125. this.onUnload = function()
  126. {
  127.    removeLinkListener();
  128.    this.onUnload = null;
  129. };
  130.